home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / progkit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-10  |  2.2 KB  |  85 lines

  1. #include "progkit.h"
  2. #include "dim.h"
  3.  
  4. void ProgramKit::exe(int)
  5.     {
  6.     if(used == 0)
  7.         return;
  8.  
  9.     mouseShowCursor();
  10.     moveTo(1);
  11.  
  12.     while(1)
  13.     {
  14.     if(!(list[current]->active()))
  15.         WindowManager::show_window(list[current]);
  16.     list[current]->exe();
  17.  
  18.     if(global_i[0])
  19.         {
  20.         if(global_i[0] > 100)
  21.         {
  22.         int w;
  23.         if(!(w = application(global_i[0] + global_num - 1)))
  24.             continue;     // it is application function only
  25.         if(w == 1)        // it is too, but after execution hide
  26.             {             // this object and pass control to previous
  27.             WindowManager::hide_window();
  28.             moveTo(list[current]->isCall());
  29.             continue;
  30.             }
  31.         // else --> it is not only application, we expect next menu
  32.         }
  33.             if(global_i[0] == AC_RESIZE || global_i[0] == AC_MOVE)
  34.         {
  35.                 rect work = list[current]->bound();
  36.                 if(global_i[0] + global_num - 1 == AC_MOVE)
  37.                     work = get_dim(FIG_RECTANGLE,
  38.                 MOVE, list[0]->bound(), work,
  39.                 loc(work.width(), work.height()));
  40.                 else
  41.                     work = get_dim(FIG_RECTANGLE,
  42.                 RESIZE, list[0]->bound(), work,
  43.                 screenLocLT(minsize));
  44.  
  45.                 WindowManager::redraw_window(work);
  46.                 continue;
  47.         }
  48.         }
  49.  
  50.     if(e.what == KEYEVENT || e.what == SHIFTKEYEVENT)
  51.         {
  52.         switch(e.key)
  53.         {
  54.         case EVENT_ALT_F3:
  55.                     if(list[current]->isRet(RET_REMOVE)
  56.                 && current > 1) // to hide
  57.                         {
  58.             WindowManager::hide_window();
  59.                         delete remove(current);
  60.                         WindowManager::show_window(list[1]);
  61.             moveTo(1);
  62.             continue;
  63.                         }
  64.             break;
  65.                 case EVENT_ALT_F4:
  66. //                    for(int i = s_used; i >= 0; i--)
  67. //                        delete remove(current);
  68.                     return;
  69.         case EVENT_ALT_TAB:                     // go to the next object
  70.             F6_shift();
  71.             break;
  72.         default: break;
  73.         }
  74.         }
  75.     else
  76.         if(e.mouse1())
  77.         {
  78.         if(!mouse_shift(e.where()))
  79.                     return;
  80. //        if(res_cur == current && list[current]->isRet(RET_MOUSE))
  81. //            return;
  82.         }
  83.     }
  84.     }
  85.